package se.webbzon.oschi01.nbt;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import se.webbzon.oschi01.singleton.Singleton;

public class FloatTagFactory extends AbstractTagFactory<Float> implements Singleton {

	private FloatTagFactory() {
		super(Tags.TAG_FLOAT, "TAG_Float");
	}

	@Override public FloatTag readTag(String tagName, DataInputStream is) throws IOException {
		return new FloatTag(this, tagName,is.readFloat());
	}

	@Override public void writeTag(Tag<Float> tag, DataOutputStream dos) throws IOException {
		dos.writeFloat(tag.getValue());
	}

	@Override public Tag<Float> createTag(String tagName) {
		return new FloatTag(this, tagName, 0f);
	}

}
